Integrand size = 19, antiderivative size = 84 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {3 a b^2 \text {arctanh}(\sin (c+d x))}{d}-\frac {\cos (c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{d}-\frac {b \sec (c+d x) \left (2 \left (a^2-b^2\right )+a b \tan (c+d x)\right )}{d} \]
3*a*b^2*arctanh(sin(d*x+c))/d-cos(d*x+c)*(b-a*tan(d*x+c))*(a+b*tan(d*x+c)) ^2/d-b*sec(d*x+c)*(2*a^2-2*b^2+a*b*tan(d*x+c))/d
Time = 1.82 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.56 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {\sec (c+d x) \left (-3 a^2 b+3 b^3+\left (-3 a^2 b+b^3\right ) \cos (2 (c+d x))-6 a b^2 \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+a^3 \sin (2 (c+d x))-3 a b^2 \sin (2 (c+d x))\right )}{2 d} \]
(Sec[c + d*x]*(-3*a^2*b + 3*b^3 + (-3*a^2*b + b^3)*Cos[2*(c + d*x)] - 6*a* b^2*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + a^3*Sin[2*(c + d*x)] - 3*a*b^2*Sin[2*(c + d *x)]))/(2*d)
Time = 0.45 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.83, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.579, Rules used = {3042, 3991, 3042, 4147, 27, 244, 2009, 4159, 27, 299, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^3}{\sec (c+d x)}dx\) |
\(\Big \downarrow \) 3991 |
\(\displaystyle \int \cos (c+d x) \left (a^3+3 b^2 \tan ^2(c+d x) a\right )dx+\int \sin (c+d x) \left (\tan ^2(c+d x) b^3+3 a^2 b\right )dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a}{\sec (c+d x)}dx+\int \sin (c+d x) \left (\tan (c+d x)^2 b^3+3 a^2 b\right )dx\) |
\(\Big \downarrow \) 4147 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a}{\sec (c+d x)}dx+\frac {\int b \cos ^2(c+d x) \left (3 a^2-b^2+b^2 \sec ^2(c+d x)\right )d\sec (c+d x)}{d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a}{\sec (c+d x)}dx+\frac {b \int \cos ^2(c+d x) \left (3 a^2-b^2+b^2 \sec ^2(c+d x)\right )d\sec (c+d x)}{d}\) |
\(\Big \downarrow \) 244 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a}{\sec (c+d x)}dx+\frac {b \int \left (b^2+\left (3 a^2-b^2\right ) \cos ^2(c+d x)\right )d\sec (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a}{\sec (c+d x)}dx+\frac {b \left (b^2 \sec (c+d x)-\left (3 a^2-b^2\right ) \cos (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 4159 |
\(\displaystyle \frac {\int \frac {a \left (a^2-\left (a^2-3 b^2\right ) \sin ^2(c+d x)\right )}{1-\sin ^2(c+d x)}d\sin (c+d x)}{d}+\frac {b \left (b^2 \sec (c+d x)-\left (3 a^2-b^2\right ) \cos (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {a \int \frac {a^2-\left (a^2-3 b^2\right ) \sin ^2(c+d x)}{1-\sin ^2(c+d x)}d\sin (c+d x)}{d}+\frac {b \left (b^2 \sec (c+d x)-\left (3 a^2-b^2\right ) \cos (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 299 |
\(\displaystyle \frac {a \left (3 b^2 \int \frac {1}{1-\sin ^2(c+d x)}d\sin (c+d x)+\left (a^2-3 b^2\right ) \sin (c+d x)\right )}{d}+\frac {b \left (b^2 \sec (c+d x)-\left (3 a^2-b^2\right ) \cos (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {a \left (\left (a^2-3 b^2\right ) \sin (c+d x)+3 b^2 \text {arctanh}(\sin (c+d x))\right )}{d}+\frac {b \left (b^2 \sec (c+d x)-\left (3 a^2-b^2\right ) \cos (c+d x)\right )}{d}\) |
(b*(-((3*a^2 - b^2)*Cos[c + d*x]) + b^2*Sec[c + d*x]))/d + (a*(3*b^2*ArcTa nh[Sin[c + d*x]] + (a^2 - 3*b^2)*Sin[c + d*x]))/d
3.6.40.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p , 0]
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[d*x *((a + b*x^2)^(p + 1)/(b*(2*p + 3))), x] - Simp[(a*d - b*c*(2*p + 3))/(b*(2 *p + 3)) Int[(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && NeQ[2*p + 3, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _), x_Symbol] :> Module[{k}, Int[Sec[e + f*x]^m*Sum[Binomial[n, 2*k]*a^(n - 2*k)*b^(2*k)*Tan[e + f*x]^(2*k), {k, 0, n/2}], x] + Int[Sec[e + f*x]^m*Tan [e + f*x]*Sum[Binomial[n, 2*k + 1]*a^(n - 2*k - 1)*b^(2*k + 1)*Tan[e + f*x] ^(2*k), {k, 0, (n - 1)/2}], x]] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^ (p_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Simp[1/(f*ff^ m) Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m + 1 )), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[( m - 1)/2]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ ))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 *x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} , x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
Time = 2.80 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.14
method | result | size |
derivativedivides | \(\frac {b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+3 a \,b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{2} b \cos \left (d x +c \right )+a^{3} \sin \left (d x +c \right )}{d}\) | \(96\) |
default | \(\frac {b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+3 a \,b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{2} b \cos \left (d x +c \right )+a^{3} \sin \left (d x +c \right )}{d}\) | \(96\) |
risch | \(-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )} b \,a^{2}}{2 d}+\frac {{\mathrm e}^{i \left (d x +c \right )} b^{3}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{3}}{2 d}+\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a \,b^{2}}{2 d}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )} b \,a^{2}}{2 d}+\frac {{\mathrm e}^{-i \left (d x +c \right )} b^{3}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{3}}{2 d}-\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a \,b^{2}}{2 d}+\frac {2 b^{3} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}\) | \(220\) |
1/d*(b^3*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2)*cos(d*x+c))+3*a*b^2*(-s in(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))-3*a^2*b*cos(d*x+c)+a^3*sin(d*x+c))
Time = 0.28 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.30 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {3 \, a b^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, a b^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b^{3} - 2 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
1/2*(3*a*b^2*cos(d*x + c)*log(sin(d*x + c) + 1) - 3*a*b^2*cos(d*x + c)*log (-sin(d*x + c) + 1) + 2*b^3 - 2*(3*a^2*b - b^3)*cos(d*x + c)^2 + 2*(a^3 - 3*a*b^2)*cos(d*x + c)*sin(d*x + c))/(d*cos(d*x + c))
\[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{3} \cos {\left (c + d x \right )}\, dx \]
Time = 0.22 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {2 \, b^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + 3 \, a b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - 6 \, a^{2} b \cos \left (d x + c\right ) + 2 \, a^{3} \sin \left (d x + c\right )}{2 \, d} \]
1/2*(2*b^3*(1/cos(d*x + c) + cos(d*x + c)) + 3*a*b^2*(log(sin(d*x + c) + 1 ) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) - 6*a^2*b*cos(d*x + c) + 2*a^3 *sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 4309 vs. \(2 (83) = 166\).
Time = 2.62 (sec) , antiderivative size = 4309, normalized size of antiderivative = 51.30 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\text {Too large to display} \]
-1/4*(3*pi*a^2*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 - tan(1/2*d*x)^2 - 4*tan( 1/2*d*x)*tan(1/2*c) - tan(1/2*c)^2 + 1)*tan(1/2*d*x)^4*tan(1/2*c)^4 - 3*pi *a^2*b*tan(1/2*d*x)^4*tan(1/2*c)^4 - 6*a^2*b*arctan((tan(1/2*d*x)*tan(1/2* c) + tan(1/2*d*x) + tan(1/2*c) - 1)/(tan(1/2*d*x)*tan(1/2*c) - tan(1/2*d*x ) - tan(1/2*c) - 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 - 6*a^2*b*arctan((tan(1/2 *d*x)*tan(1/2*c) - tan(1/2*d*x) - tan(1/2*c) - 1)/(tan(1/2*d*x)*tan(1/2*c) + tan(1/2*d*x) + tan(1/2*c) - 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 + 6*a*b^2*l og(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/ 2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*t an(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^ 2 + 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 - 6*a*b^2*log(2*(tan(1/2*d*x)^2*tan(1/ 2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1 /2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x )^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^4*tan( 1/2*c)^4 - 12*pi*a^2*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 - tan(1/2*d*x)^2 - 4*tan(1/2*d*x)*tan(1/2*c) - tan(1/2*c)^2 + 1)*tan(1/2*d*x)^3*tan(1/2*c)^3 + 12*a^2*b*tan(1/2*d*x)^4*tan(1/2*c)^4 - 8*b^3*tan(1/2*d*x)^4*tan(1/2*c)^4 + 12*pi*a^2*b*tan(1/2*d*x)^3*tan(1/2*c)^3 + 24*a^2*b*arctan((tan(1/2*d*x) *tan(1/2*c) + tan(1/2*d*x) + tan(1/2*c) - 1)/(tan(1/2*d*x)*tan(1/2*c) - ta n(1/2*d*x) - tan(1/2*c) - 1))*tan(1/2*d*x)^3*tan(1/2*c)^3 + 24*a^2*b*ar...
Time = 4.69 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.38 \[ \int \cos (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {6\,a\,b^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (6\,a\,b^2-2\,a^3\right )-6\,a^2\,b-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a\,b^2-2\,a^3\right )+4\,b^3+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-1\right )} \]